package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.IncomeDao;
import entity.Income;
import entity.Leave;
import biz.IncomeBiz;

public class IncomeBizImpl implements IncomeBiz {
	private IncomeDao incomeDao;

	public List<Income> findAll(Integer id) {
		return incomeDao.findAll(id);
	}

	public Income findById(Integer id) {
		return incomeDao.findById(id);
	}

	public int add(Income income) {
	
		return incomeDao.add(income);

	
	}

	public int delete(Income income) {
		return incomeDao.delete(income);
	}

	public int update(Income income) {
		return incomeDao.update(income);
	}

	public List<Income> findByParam(Map map) {
		// TODO Auto-generated method stub
		return null;
	}

	public IncomeDao getIncomeDao() {
		return incomeDao;
	}

	public void setIncomeDao(IncomeDao incomeDao) {
		this.incomeDao = incomeDao;
	}

	public Integer count(){
		return incomeDao.count();
	}
	public List<Income> findByPage(Integer pageNo, Integer rows){
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return incomeDao.findByPage(map);
	}

}
